<div class="fsh-pop">
    <div id="add_form" class="layui-form" lay-filter="add_form">
        <input type="hidden" name="user_id" id="user_id" value="<%=user_id%>"/>
        <input type="hidden" name="default_status" id="default_status" value="<%=status%>"/>
        <div class="layui-form-item">
            <label class="layui-form-label"><i>*</i>用户名</label>
            <div class="layui-input-block">
                <input type="text" name="username" lay-verify="" readonly="readonly" class="layui-input" value="">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i>*</i>姓名</label>
            <div class="layui-input-block">
                <input type="text" name="nickname" lay-verify="" readonly="readonly" class="layui-input" value="">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><i>*</i>状态</label>
            <div class="layui-input-block">
                <select id="status" lay-filter="parent" name="status">

                </select>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    // var defaultStatus = $("#default_status").val();
    layui.use(['form'], function () {
        var form = layui.form;
        var originData = JSON.parse($('<div>').html('<%=$data%>').text());
        var state = originData.state || 0;
        var titles = ['正常', '锁定', '解锁', '永久锁定'];
        var status = [0, 1];
        var html = "<option value=''>请选择</option>";
        for (var i = 0; i < titles.length; i++) {
            html += "<option value=" + status[i] +  (state==i?' checked=checked ':'') + ">" + titles[i] + "</option>";
        }
        $("#status").append(html);
        $("#status").val(state);
        form.render("select");
        form.val('add_form', originData);

    });


</script>